# -*- coding:UTF-8 -*-
def threeSumClosest(self, numbers, target):
        # write your code here
    if len(numbers)<3:
        return -1
    if len(numbers)==3:
        return sum(numbers)
    numbers.sort()
    s=numbers[0]+numbers[1]+numbers[2]
    for i in xrange(len(numbers)):
        start=i+1
        end=len(numbers)-1
        while start<end:
            temp=numbers[start]+numbers[end]+numbers[i]
            if abs(temp-target)<abs(s-target):
                s=temp
            if temp<target:
                start+=1
            else :
                end-=1

    return s

print threeSumClosest("",[1,2,3],50)
